package ch01.ts;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * Created by zc on 2016/1/14.
 */
public class TimeClient {

    public static void main(String[] args) throws MalformedURLException {
        URL url = new URL("http://127.0.0.1:9876/ts?wsdl");

        QName qname = new QName("http://ts.ch01/", "TimeServerImplService");

        Service service = Service.create(url, qname);

        TimeServer timeServer = service.getPort(TimeServer.class);

        for(int i=0; i<1000000; i++){
//            System.out.println(timeServer.getTimeAsElapsed());
            System.out.println(timeServer.getTimeAsString());
        }

    }
}
